package main

import "fmt"

//defer 按照栈的顺序 先进后出

func main() {

	defer func() {
		fmt.Println("打印前")
	}()

	defer func() {
		fmt.Println("打印中")
	}()

	defer func() {
		fmt.Println("打印后")
	}()

	panic("触发异常....") //panic内容会在defer动作执行完毕之后打印
}
